<?php
/**
 * 
 * @author quentin Laujac, Charles Hurtevent
 *
 */
class Commande {
	private $Client;
	private $numeroCommande;
	private $dateCommande;
	private $LieuLivraison;
	private $facture;
	private $listArticle;
	private $estValidee = false;
	private $estColisFait = false;
	/**
	 * Donne le montant total de la commande
	 */
	public function getMontantTotal() {
		$montant = 0;
		foreach ($this->listArticle as $article ) {
			$montant += $article->getPrixUnitaire() * $article->getQuantiteCommandee();
		}
		
		return $montant;
	}
	
	//GETTER 
	public function getClient() {
		return $this->Client;
	}
	public function getNumeroCommande() {
		return $this->numeroCommande;
	}
	public function getDateCommande() {
		return $this->dateCommande;
	}
	public function getLieuLivraison() {
		return $this->LieuLivraison;
	}
	public function getFacture() {
		return $this->facture;
	}
	public function getListArticle() {
		return $this->listArticle;
	}
	public function isValide() {
		return $this->estValidee;
	}
	public function isColisFait(){
		return $this->estColisFait;
	}
	
	
	//SETTER
	public function setClient(Utilisateur $client) {
		$this->Client = $client;
	}
	public function setNumeroCommande($numCommande) {
		$this->numeroCommande = $numCommande;
	}
	public function setDateCommande($dateCommande) {
		$this->dateCommande = $dateCommande;
	}
	public function setLieuLivraison(Lieu $lieuLivraison) {
		$this->LieuLivraison = $lieuLivraison;
	}
	public function setFacture(Facture $facture) {
		$this->facture = $facture;
	}
	public function setListArticle(ArrayObject $listArticle) {
		$this->listArticle = $listArticle;
	}
	public function setEstValide($estValide) {
		$this->estValidee = $estValide;
	}
	public function setColisFait($estColisFait){
		$this->estColisFait = $estColisFait;
	}
}